home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 301-325 / disk_309 / csh / shell.doc < prev    next >
Text File  |  1992-05-06  |  45KB  |  1,440 lines

  1.  
  2.         INSTRUCTIONS FOR SHELL Version: 4.00A 13-Jan-90
  3.         ===============================================
  4.  
  5.   Contents
  6.   --------
  7.  
  8.     O.    Changes over old versions
  9.     I.    Description
  10.     II.   Overview of Major features
  11.     III.  Restrictions
  12.     IV.   PIPES
  13.     V.    Command Pre-processor
  14.     VI.   Command Line Editing
  15.     VII.  Function Keys
  16.     VIII. Shell Commands
  17.     IX.   Special Set Variables
  18.     X.    Advanced Topics
  19.     XI.   Example login file
  20.     XII.  Example source files
  21.     XIII. Default values
  22.     XIV.  Why ARP ?
  23.  
  24.  
  25. *********************************************************************************
  26. * NOTE TO VERSION 4.00: THIS VERSION HAS A LOT OF IMPROVEMENTS OVER THE        *
  27. * PREVIOUS ONES; WE EXPECT IT TO HAVE A BIT MORE BUGS THAN USUAL.        *
  28. * WE HOPE ALL OF YOU WILL CONTINUE TO HELP US WITH SUGGESTIONS AND BUG REPORTS.    *
  29. *                                         *
  30. *         THANKS                                *
  31. *            CARLO & CESARE                        *
  32. *********************************************************************************
  33.  
  34.  
  35. O.  Changes over old version
  36.     ------------------------
  37.  
  38. New to 4.00A:
  39.  
  40. - This version is called 4.00A because it is not 100% compatible with
  41.   previous versions. We choose to accept this in order to better support
  42.   the new ARP.library 1.3.
  43. - External commands are searched in a different order than before; Shell
  44.   path is now searched AFTER current directory, AmigaDOS path and C:.
  45. - ARP pattern matching has been implemented (in part for line arg expanding,
  46.   fully for search -w).
  47. - Internal changes for various optimizations.
  48. - Search command has been improved in several ways.
  49. - New commands: basename, tackon.
  50. - New options: if -v, resident -d, fornum -v -s, dir -n.
  51. - Fixed bugs with dir (some dirs remained locked), foreach -v, htype
  52.   (blanks were treated as binary), info (for devices > 32M).
  53. - rback command now works ok (run, however, doesn't).
  54. - Oh, I forgot: it also has an AREXX port... And you don't even have to get
  55.   AREXX to use it. See new commands rxsend, rxrec
  56.  
  57. New to 3.03A:
  58.  
  59. - New filter commands fltlower, fltupper.
  60. - Added configuration file feature: now if you have a file named S:.login,
  61.   it will be sourced for every Shell you start.
  62. - New option dir -c.
  63. - New editing feature: shift-left(right) arrow move cursor to previous(next)
  64.   word.
  65. - Bugs fixed: alias command wasn't listed in help; typing a number as a
  66.   command was interpreted like 'alias'.
  67.  
  68. New to 3.02A:
  69.  
  70. - New commands: fornum, forline, strleft, strright, strmid, strlen, exec.
  71. - Improved commands: foreach, pri.
  72. - New system variable _clinumber.
  73. - You can now split long lines in source files (see source for details).
  74. - window -q now lists also position of screens/windows, not only dimension.
  75. - Since strings are handled directly from Shell with new commands,
  76.   rpn is now used only for calculations; string commands are gone.
  77.   However, now RPN is really usable.
  78. - Changed rawgets() to fix some problems with function keys, multi-line
  79.   editing and window resizing; also, fixed bug with ^E.
  80. - cat now warns you if it can't find any file matching your pattern.
  81. - Now uses DOS packets to get ptr to CLI window; this fixes a bug that
  82.   caused problems if Shell was run on unactive windows.
  83. - Fixed minor bugs (htype printed some more ASCII bytes, some commands
  84.   returned random values, history didn't print CR's).
  85. - Heavy mods to this file.
  86.  
  87. New to 3.01A:
  88.  
  89. - Fixed bug with strings: before it printed strings with lenght 1 more
  90.   than specified lenght.
  91. - Made some additions and corrected many errors in Shell.doc (this file).
  92. - Modified handler of external commands to allow things like DATE "?"
  93.   (always use quotes).
  94. - Corrected cat: it didn't work with STDIN before.
  95.  
  96. I.  Description
  97.     -----------
  98.  
  99. This version of Shell is the follow of:
  100.     Shell V2.04 (C)Copyright 1986, Matthew Dillon, All Rights Reserved
  101.     Shell V2.04M-V2.07M by Steve Drew
  102.     Shell V2.08MI and V3.xxA by Carlo Borreo & Cesare Dieni
  103.  
  104. Send suggestions/criticism/anything else to Carlo Borreo or Cesare Dieni at:
  105.  
  106.     BITNET:  PERUGIA@ICNUCEVM.BITNET
  107.     FIDONET: 2:332/23.0@FIDONET
  108.  
  109. or
  110.     Carlo Borreo        Cesare Dieni
  111.     Via G. Berio 34        Via G. Taddei 3
  112.     I-18100 Imperia        I-56100 Pisa
  113.     Italy            Italy
  114.  
  115. You may distribute this program for non-profit only.
  116.  
  117.     Attributions
  118.     ------------
  119.  
  120. Arexx is a program by William Hawes.
  121. Cygnus Ed Professional (C) 1988 CygnusSoft Software.
  122.  
  123. II. OVERVIEW
  124.     --------
  125.  
  126. Shell provides a convient AmigaDos alternative command interface.
  127. All its commands are internal and thus does not rely on the c:
  128. commands for any functionality.
  129.  
  130. Major features include:
  131.  
  132.     -command line editing
  133.     -shell & Amigados search path support
  134.     -simple history
  135.     -redirection of any command
  136.     -piping
  137.     -aliases
  138.     -variables & variable handling (embedded variables)
  139.     -file name expansion via conventional wild carding ('?', '*' and more)
  140.     -conditionals (if/else ect..)
  141.     -source files  (w/ gotos and labels)
  142.     -many built in commands to speed things up
  143.  
  144.  
  145. III. RESTRICTIONS
  146.      ------------
  147.  
  148.     o AmigaDos execute command will not work. Alternative is to use shell
  149.       own script language (which is more powerful) or to do a 'run execute'.
  150.     o VDK handler has a bug with setting file dates so when using the copy
  151.       command and VDK you should use the -d switch otherwise your file date
  152.       in vdk: will be bad. (This is not a bug with shell)
  153.     o If using with conman it may be best to start shell with the -a switch
  154.       (shell -a .login) to turn off shell's command line editing and use
  155.       conmans instead.
  156.  
  157.  
  158. IV. NOTES ON PIPES
  159.     --------------
  160.  
  161.     PIPES have been implimented using temporary RAM: files.  Thus, you
  162.     should be careful when specifying a 'ram:*' expansion as it might
  163.     include the temp. files.  These files are deleted on completion of
  164.     the pipe segment.
  165.  
  166.     The file names used are completely unique, even with multiple shell
  167.     running simultaniously.
  168.  
  169.     My favorite new feature is the fact that you can now redirect to and
  170.     from, and pipe internal commands.  'echo charlie >ram:x', for
  171.     instance.  Another favorite:
  172.  
  173.        echo "echo mem | shell" | shell
  174.  
  175.     To accomplish these new features, I completely re-wrote the command
  176.     parser in execom.c
  177.  
  178.     NO BCPL program should be output-append redirected (>>).
  179.  
  180.  
  181. V.  COMMAND PRE-PROCESSOR
  182.     ---------------------
  183.  
  184.     Preprocessing is done on the command line before it is passed on to
  185.     an internal or external routine:
  186.  
  187.     ^c    where c is a character is converted to that control character.
  188.         Thus, say '^l' for control-l.
  189.  
  190.     $name    where name is a variable name.  Variable names can consist of
  191.         0-9, a-z, A-Z, and underscore (_).  The contents of the
  192.         specified variable is used.  If the variable doesn't exist,
  193.         the specifier is used.  That is, if the variable 'i' contains
  194.         'charlie', then '$i' -> 'charlie'.  If the variable 'i' doesn't
  195.         exist, then '$i'->'$i' .
  196.  
  197.     ;    delimits commands.   echo charlie ; echo ben.
  198.  
  199.     ' '    (a space). Spaces delimit arguments.
  200.  
  201.     "string" a quoted string.  For instance, if you want to echo five spaces
  202.         and an 'a':
  203.  
  204.         echo      a       -> a
  205.         echo "    a"      ->      a
  206.  
  207.     \c    overide the meaning of special characters.  '\^a' is a
  208.         circumflex and an a rather than control-a.  To get a backslash,
  209.         you must say '\\'.
  210.  
  211.         also used to overide alias searching for commands.
  212.  
  213.     >file    specify output redirection.  All output from the command is
  214.         placed in the specified file.
  215.  
  216.     >>file    specify append redirection (Does not work with BCPL programs).
  217.  
  218.     <file    specify input redirection. The command takes input from the
  219.         file rather than the keyboard (note: not all commands require
  220.         input; it makes no sense to say 'echo <charlie' since
  221.         the 'echo' command only outputs its arguments).
  222.  
  223.     |    PIPE specifier.  The output from the command on the left becomes
  224.         the input to the command on the right.  The current SHELL
  225.         implimentation uses temporary files to store the data.
  226.  
  227.     !!    execute the previously executed command.
  228.     !nn    (nn is a number).  Insert the history command numbered n (see
  229.         the HISTORY command)
  230.     !partial search backwards through the history list for a command which
  231.         looks the same as 'partial', and execute it.
  232.  
  233.     #    Enter comment.  The rest of the line is discarded (note: \#
  234.         will, of course, overide the comment character's special
  235.         meaning)
  236.  
  237.  
  238. VI. COMMAND LINE EDITING
  239.     --------------------
  240.  
  241.     o Command line can be upto 255 chars.
  242.     o Inserts and deletes are handled correctly over multiple screen lines.
  243.     o Shell will keep track of the line width should the window get resized.
  244.  
  245.     KEY DEFINITIONS:
  246.         Up Arrow    Recall previous commands
  247.         Down Arrow  Recall commands
  248.         Left Arrow  Move cursor about command line.
  249.         Right Arrow  "     "      "      "      "
  250.         Shift-Up Arrow    Get start of history
  251.         Shift-Down Arrow   "  end   "     "
  252.         Shift-Left Arrow  Moves cursor a word left
  253.         Shift-Right Arrow   "     "    "  "   right
  254.         ^A        Toggle insert/overtype mode.
  255.         ^D        EOF (exits Shell)
  256.         ^E        Put cursor at end of text.
  257.         ^K        Delete to end of line.
  258.         ^R        Retype current line.
  259.         ^U        Erase entire line.
  260.         ^X        Erase entire line.
  261.         ^Z        Put cursor at start of text.
  262.         f1 - f10    Execute command if variable exists.
  263.         F1 - F10    More commands (Shifted f keys).
  264.         Help        Invokes help command
  265.  
  266.  
  267. VII. FUNCTION KEYS
  268.      -------------
  269.  
  270.     Function keys now insert text to the current position on the command
  271.     line. They maybe terminated with a ^M (return). f1 would be non shifted
  272.     where as F1 is shifted.
  273.     Most of functions key have a default definition, but it may be changed.
  274.  
  275.       $ set f1 dir df0:^M
  276.  
  277.     will add the text 'dir df0:<return>' to the current line.
  278.  
  279.       $ set f1 dir
  280.  
  281.     would only add 'dir' you could then enter ' df0:<return>'
  282.  
  283.  
  284. VIII. SHELL COMMANDS
  285.       ---------------
  286.  
  287.    First to start shell from a CLI
  288.  
  289.    shell [-a] [-c command;command]
  290.  
  291.    where:
  292.     -a disables all command line editing features. This is useful for
  293.     when running shell over AUX:, and necessary if you are running
  294.     CONMAN.
  295.  
  296.     -c allows execution of one command line and then exits out of shell.
  297.     This is useful for running a internal shell commands in the
  298.     background or from an external application. eg:
  299.  
  300.         Run shell -c dir df0:; copy -r df0: df1: >nil:; echo "Done"
  301.  
  302.     If you 'Run' shell in the background without the -c switch shell
  303.     will detect this and imediatley exit.
  304.  
  305.    Command execution:
  306.  
  307.    Internal shell commands maybe abreviated.
  308.  
  309.    The first argument is the command-name... here is (in order) how Shell
  310.    tries to execute it:
  311.  
  312.     1) Alias list is searched for an alias exactly matching name.
  313.     2) Internal commands list is scanned for a command even partially
  314.        matching name (so you can, for instance, say resi for resident;
  315.        however, you should specify enough of a command to be unique).
  316.     3) ARP resident list is scanned (you can use Shell's resident
  317.        command to add/remove a file in this list).
  318.     4) At this point, command is supposed to be external (disk), and
  319.        is searched before in current directory, then in AmigaDOS
  320.        path, in C:, and finally in Shell path.
  321.     5) As a last chance, AUTOMATIC SOURCING is tried, first in
  322.            current directory, then in Shell path.
  323.  
  324.    AUTOMATIC SOURCING may be accomplished by naming shell scripts with a
  325.    .sh suffix.  Thus, if you say 'stuff' and the file 'stuff.sh' exists in
  326.    your current or anywhere in Shell search path, it will be SOURCED with
  327.    any arguments you have placed in the $_passed variable.
  328.    This is equivalent to typing 'source stuff.sh'
  329.  
  330.    Wild card expansions:
  331.     Most shell commands will accept multiple arguments that can
  332.     be as a result of wild card expansion. Also when the calling
  333.     an external command shell will first expand any wild cards
  334.     to seperate arguments. If you wish to have the external command
  335.     handle it's own wild carding you will need to insert quotes
  336.     around the special wild card characters.
  337.  
  338.     eg.
  339.         arc a new.arc *.txt    - shell will expand and pass to arc
  340.         arc a new.arc "*.txt"    - let arc expand the wild cards.
  341.  
  342.     Wild card expansions:
  343.  
  344.     ?    match any single character
  345.     *    match any string
  346.     .../*    recursive search down ALL sub directories from current level
  347.     ~    exclude pattern matching specifier
  348.     !    synonim for ~, supported for compatibility
  349.     &    prefixed to patterns, ask confirmation for each file
  350.     []    character class
  351.  
  352.     Examples:
  353.  
  354.     df0:.../*        all files in all directories on df0:
  355.     df0:.../!*.info     full directory tree of df0: but exclude
  356.                 any ugly .info files.
  357.     !*.o !*.c        will result in ALL files matching since what
  358.                 doesn't match the !*.o will match the !*.c
  359.     df1:&*            all files in root of df1:, but ask 
  360.                 confirmation for each
  361.     *.[co]            all files ending in .c or .o
  362.     ~*.[co]            all files NOT ending in .c nor in .o
  363.  
  364.  
  365.     The following symbols are not yet supported by wild card expansions,
  366.     but are accepted in search -w.
  367.  
  368.     ( | )    OR matching
  369.     #    0 or more times the pattern following
  370.  
  371.     Examples:
  372.  
  373.     k#a        matches ka, kaa, kaaa, etc.
  374.     hel(lo|p)    matches hello or help.
  375.  
  376.  
  377.     LIST OF COMMANDS:
  378.     -----------------
  379.  
  380.     ABORTLINE
  381.     Usage    : abortline
  382.     Example    : echo a;abort;echo b
  383.     Results    : a
  384.  
  385.     Causes the rest of the line to be aborted. Intended for use in
  386.     conjunction with exception handling.
  387.  
  388.     ADDBUFFERS
  389.     Usage    : addbuffers drive buffers
  390.     Example    : addbuffers df0: 24
  391.  
  392.     Just like AmigaDOS addbuffer command, causes new buffers to be
  393.     allocated for disk I/O. Each buffer costs 512 bytes of CHIP memory.
  394.  
  395.     ALIAS
  396.     Usage    : alias [name [command string] ]
  397.     Example    : alias vt "echo Starting VT100;run sys:tools/vt100"
  398.  
  399.     Sets a name to be a string. You can alias a single name to a set
  400.     of commands if you enclose them in quotes as above. By simply
  401.     typing vt, the command line above would be executed.
  402.  
  403.     Argument Passing to an Alias:
  404.  
  405.     Usage    : alias name "%var [command string]"
  406.     Example    : alias xx "%q echo hi $q, how are ya."
  407.           xx Steve
  408.     Results    : hi Steve, how are ya.
  409.  
  410.     The second form of the alias command allows passing of arguments
  411.     to any position within the command string via use of a variable
  412.     name. To pass arguments to the end of a command string this method
  413.     is actually not necessary.
  414.  
  415.     Typing "alias name" you will get the alias for that name, while with
  416.     "alias" you get a list of all alias.
  417.  
  418.     ASET
  419.     Usage    : aset name value
  420.     Example    : aset INCLUDE include:
  421.  
  422.     Set a variable in a way that is compatible with Aztec SET command;
  423.     this is completely different from Shell variable.
  424.     May even be used to set ARP variables.
  425.  
  426.     ASSIGN
  427.     Usage    : assign [logical [physical] ]
  428.     Example    : assign C: df1:c
  429.  
  430.     Use it like AmigaDOS assign command to set, remove or list
  431.     assignments of logical names to directories.
  432.  
  433.     BASENAME
  434.     Usage    : basename var path
  435.     Example    : basename x df0:c/Dir    # sets x to "Dir"
  436.  
  437.     Sets var specified to basename of path.
  438.  
  439.     CAT
  440.     Usage    : cat [-n][file file....]
  441.     Example    : cat foo.txt
  442.  
  443.     Type the specified files onto the screen.  If no file is specified,
  444.     STDIN in used.  CAT is meant to output text files only.
  445.     Specifying -n option you will get numbered lines.
  446.  
  447.     CD
  448.     Usage    : cd [path]
  449.     Example    : cd df0:devs/printers
  450.  
  451.     Change your current working directory.  You may specify '..' to go
  452.     back one directory (this is a CD specific feature, and does not
  453.     work with normal path specifications).
  454.  
  455.     CD without any arguments displays the path of the directory you
  456.     are currently in.
  457.  
  458.     CLOSE
  459.     Usage    : close filenumber
  460.  
  461.     Close the specified file opened by open.
  462.     See open and flist for more info.
  463.  
  464.     COPY
  465.     (CP)
  466.     Usage    : copy [-u][-d] file file
  467.     or    : copy [-u][-d] file1 file2...fileN dir
  468.     or    : copy [-r][-u][-d] dir1 dir2...dirN dir
  469.     options    :
  470.         -r    recursive, copy all subdirectories as well.
  471.         -u    update, if newer version exist on dest, don't copy
  472.         -d    don't set destination file date to that of source.
  473.  
  474.     Example    : copy -r df0: df1:
  475.  
  476.     Copy files or directories. When copying directories, the -r option
  477.     must be specified to copy subdirectories as well.  Otherwise, only
  478.     top level files in the source directory are copied.
  479.  
  480.     All files will be displayed as they are copied and directory's
  481.     displayed as they are created. This output can be suppessed by
  482.     redirecting to nil: eg. copy -r >nil: df0: df1:
  483.  
  484.     Copy will abort after current file on Control-C.
  485.  
  486.     Copy by default sets the date of the destination file to that of
  487.     the source file. To overide this feature use the -d switch.
  488.  
  489.     Another useful option is the -u (update) mode were copy will not
  490.     copy any files which exists already in the destination directory
  491.     if the destination file is newer or equal to the source file.
  492.     This is useful when developing code say in ram: eg. 'copy *.c ram:'
  493.     when done you can copy -u ram: df1: and only those modules you have
  494.     modified will be copied back.
  495.  
  496.     Copy command will now create the destination directory if it does
  497.     not exist when specified as 'copy [-r] dir dir'. If you specify
  498.     copy file file file dir, then 'dir' must already exist.
  499.  
  500.     CP
  501.     Equivalent to copy.
  502.  
  503.     DATE
  504.     Usage    : date [new date and/or time]
  505.     Example    : date Wednesday  # this refers to NEXT wed, of course
  506.  
  507.     Used to read or set system date and/or time. All standard options
  508.     may be used (yesterday, tomorrow, monday, etc.).
  509.     Leading zero's are not necessary.
  510.     Without parameters shows Dddddd DD-MMM-YY HH:MM:SS.
  511.  
  512.     DEC
  513.     Usage    : dec varname [value]
  514.     Example    : dec abc
  515.  
  516.     Decrement the numerical equivalent of the variable with specified
  517.     value (default: 1) and place the ASCII-string result back into
  518.     that variable.
  519.  
  520.     DELETE
  521.     (RM)
  522.     Usage    : delete [-p][-r] file file file...
  523.     Example    : delete foo.txt test.c
  524.  
  525.     Remove (delete) the specified files.  Remove always returns
  526.     errorcode 0.  You can remove empty directories.  The '-r' option
  527.     will remove non-empty directories by recursively removing all sub
  528.     directories.
  529.     You can remove delete-protected files specifying -p option.
  530.     If you specify any wildcard deletes the files will be listed as
  531.     they are deleted. This can be suppressed by redirecting to nil:
  532.  
  533.     DIR
  534.     (LS)
  535.     Usage    : dir [-sdfcn] [path path ... ]
  536.     Example    : dir df0:
  537.     options    :
  538.         -s  short multi(4) column display.
  539.         -d  list directories only
  540.         -f  list files only
  541.         -c  don't change colors for directories (useful to printer)
  542.         -n  display names only
  543.  
  544.     Displays a directory of specified files. Default output shows
  545.     date, protection, block size, byte size and total space used.
  546.     Protections flags include new 1.2/1.3 flags (see under protect).
  547.     Files are alphabetically sorted, without case sensitivity, and
  548.     directories are in red pen (unless you use -c).
  549.  
  550.     DISKCHANGE
  551.     Usage    : diskchange drive
  552.  
  553.     Like AmigaDOS diskchange.
  554.  
  555.     ECHO
  556.     Usage    : echo [-n] string
  557.     Example    : echo hi there
  558.     Results    : hi there
  559.  
  560.     Echo the string given. If -n switch given no newline is
  561.     appended.
  562.  
  563.     ELSE ;
  564.     Usage    : else ; command
  565.     Usage    : if -f foo.c ; else ; echo "Not there" ; endif
  566.  
  567.     Else clause, must follow an IF statement.
  568.  
  569.     ENDIF
  570.     Usage    : endif
  571.  
  572.     The end of an if statement.
  573.  
  574.     Note: if you return from a script file with unterminated IF's
  575.     and the last IF was false, prompt will be changed to an
  576.     underscore ('_') and no commands will be executed until
  577.     'endif' is typed.
  578.  
  579.     EXEC
  580.     Usage    : exec command
  581.     Example    : set util SYS:sytem/utilities
  582.           exec $util/make    # would not work without exec
  583.  
  584.     Execute the command specified; exec command is equivalent to
  585.     command, only you can use variables to specify command name.
  586.  
  587.     FAULT
  588.     Usage    : fault error1 .. errorN
  589.     Example    : fault 205 212
  590.  
  591.     Like AmigaDOS fault, prints specified error messages.
  592.  
  593.     FILENOTE
  594.     Usage: filenote file1 .. filen  note
  595.  
  596.     Set AMIGADOS comment of the specified file. This is not very useful,
  597.     since in current implementation of Shell file comments are not listed
  598.     in directory, but it was so easy to implement...
  599.  
  600.     FLIST
  601.     Usage    : flist
  602.  
  603.     Lists the filenumbers of files opened by open.
  604.     See open and close for more info.
  605.  
  606.     FLTLOWER
  607.     Usage    : fltlower
  608.     Example    : dir | fltlower
  609.     Or    : fltlower <readme
  610.  
  611.     This is a filter command, i.e. it reads from stdin and writes to
  612.     stdout. The more natural way to use it is a pipe, or it can be
  613.     redirected.
  614.     Its purpose is to convert all alphabetic to lower case.
  615.  
  616.     FLTUPPER
  617.     The same of fltlower, only this converts to upper case.
  618.  
  619.     FOREACH
  620.     Usage    : foreach [-v] varname ( strings ) command
  621.     Example    : foreach i ( a b c d ) "echo -n $i;echo \" ha\""
  622.     Result    : a ha
  623.           b ha
  624.           c ha
  625.           d ha
  626.  
  627.     'strings' is broken up into arguments.  Each argument is placed in
  628.     the variable 'varname' in turn and 'command' executed.  To execute
  629.     multiple commands, place them in quotes.
  630.  
  631.     Foreach is especially useful when interpreting passed arguments in
  632.     an alias.
  633.  
  634.     eg.
  635.         foreach i ( *.pic ) viewilbm $i
  636.     assuming a.pic and b.pic in current directory the following commands
  637.     will occur:
  638.         viewilbm a.pic
  639.         viewilbm b.pic
  640.  
  641.     Flag -v causes arguments to be displayed every time command is
  642.     executed.
  643.  
  644.     FOREVER
  645.     Usage    : forever command
  646.     or    : forever "command;command;command..."
  647.  
  648.     The specified commands are executed over and over again forever.
  649.  
  650.     -Execution stops if you hit ^C
  651.     -If the commands return with an error code.
  652.  
  653.    FORLINE
  654.     Usage    : forline var filename command
  655.     or    : forline var filename "command;command..."
  656.     Example    : forline i RAM:temp "echo line $_linenum=$i"
  657.  
  658.     For each ASCII line of file specified commands are executed and
  659.     var points to line content. You can check system variable _linenum
  660.     to find the number of the line currently read.
  661.  
  662.    FORNUM
  663.     Usage    : fornum [-v] var n1 n2 command
  664.     or    : fornum [-v] -s var n1 n2 step command
  665.     Example    : fornum -v x 1 10 echo $1
  666.     or    : fornum -s x 10 1 -1 echo $i # counts backwards
  667.  
  668.     Executes command(s) for all numerical values of x between n1 and n2.
  669.     If more than one command is specified, or command is redirected,
  670.     include command(s) in quotes.
  671.     Switch -v (verbose) causes printing of progressive numbers.
  672.     Switch -s allows you to specify a step; if this is negative, the
  673.     count will be backwards.
  674.  
  675.    GOTO
  676.     Usage    : goto label
  677.     Example    :
  678.           label start
  679.             echo "At start"
  680.             dir ram:
  681.             goto start
  682.  
  683.     Goto the specified label name.  You can only use this command from a
  684.     source file. Labels may now be forward or reverse from current
  685.     position.
  686.  
  687.     HELP
  688.     Usage    : help
  689.     Example    : help
  690.  
  691.     Simply displays all the available commands.  The commands are
  692.     displayed in search-order.  That is, if you give a partial name
  693.     the first command that matches that name in this list is the one
  694.     executed.  Generally, you should specify enough of a command so that
  695.     it is completely unique.
  696.  
  697.     HISTORY
  698.     Usage    : history [partial_string]
  699.     Example    : history
  700.  
  701.     Displays the enumerated history list.  The size of the list is
  702.     controlled by the _history variable.  If you specify a partial-
  703.     string, only those entries matching that string are displayed.
  704.  
  705.     HOWMANY
  706.     Usage    : howmany
  707.  
  708.     This command tells you how many instances of Shell are running
  709.     in your system.
  710.  
  711.     HTYPE
  712.     Usage    : htype file1 .. filen
  713.  
  714.     Displays the specified files in hex and ASCII, just like the system
  715.     command Type file opt h. Especially suitable for binary files.
  716.  
  717.     IF
  718.     Usage    : if [-n] argument conditional argument ;
  719.     or    : if [-n] argument
  720.     or    : if [-n] -f file
  721.     or    : if [-n] -d file/dir
  722.     or    : if [-n] -m
  723.     or    : if [-n] -t file file1 .. fileN
  724.     or    : if [-n] -r rpnexpression
  725.     or    : if [-n] -v varname
  726.  
  727.     If a single argument is something to another argument.  Conditional
  728.     clauses allowed:
  729.  
  730.     <, >, =, and combinations (wire or).  Thus <> is not-equal, >=
  731.     larger or equal, etc...
  732.  
  733.     If arguments are not numeric, they are compared as strings.
  734.  
  735.     Usually the argument is either a constant or a variable ($varname).
  736.  
  737.     The second form if IF is conditional on the existance of the argument.
  738.     If the argument is a "" string, then false , else TRUE.
  739.  
  740.     The third form of IF used by -f switch checks for existance of
  741.     the specified file.
  742.  
  743.     Switch -d tests the type of the object specified: if it is a
  744.     directory, then TRUE; if it is a file (or it doesn't exist)
  745.     then FALSE.
  746.  
  747.     Switch -m is used to test if FAST memory is present, i.e. wheter
  748.     more than 512K RAM are available.
  749.     Example (to be included in a login.sh file):
  750.     if -m; resident -d lc1 lc2 blink; endif
  751.  
  752.     Using -t form compares the date and time of the first file with
  753.     all the others; if the first is younger than ALL the others, then
  754.     FALSE, else TRUE. If a file doesn't exists, it is considered as
  755.     being older.
  756.     This feature is especially useful for building makefiles without
  757.     using any MAKE utility.
  758.     Example:
  759.     if -t test.o test.asm test.i ; asm -o test.o test.asm ; endif
  760.  
  761.     Option -r evaluates a given RPN expression (see under RPN for more
  762.     info): if value on top of stack is 0, then FALSE, else TRUE.
  763.  
  764.     Switch -n (NOT) reverses the result.
  765.  
  766.     To test if a given variable is defined, use if -v varname.
  767.  
  768.     When using 'IF' command interactively if you are entering commands
  769.     following an 'IF' that was false, the prompt will be set to a
  770.     underscore '_ ' to indicate all commands will be ignored until
  771.     an 'ELSE' or 'ENDIF' command is seen.
  772.  
  773.     INC
  774.     Usage    : inc varname [value]
  775.     Example    : inc abc 5
  776.  
  777.     Increment the numerical equivalent of the variable with specified
  778.     value (default: 1) and place the ascii-string result back into
  779.     that variable.
  780.  
  781.     INFO
  782.     Usage    : info
  783.  
  784.     Display Device statistics for all the disk-type devices in system
  785.     (DFk:, HDk, JHk:, RAM:, RDk: ...), just like the system command
  786.     info. Gives block used/free, % used, errs, status and volume name.
  787.  
  788.     INPUT
  789.     Usage    : input var var ... var
  790.     Example    : input abc
  791.  
  792.     Input from STDIN (or a redirection, or a pipe) to a variable.  The
  793.     next input line is placed in the variable.
  794.  
  795.     JOIN
  796.     Usage    : join [-r] file1..fileN destfile
  797.     Example    : join part1 part2 part3 total
  798.  
  799.     Joins the specified files to get destfile. If destfile already
  800.     exists, an error message is generated and operation is aborted,
  801.     unless you specify -r (replace) option.
  802.  
  803.     LABEL
  804.     Usage    : label name
  805.  
  806.     Create a program label right here. Used in source files, can then
  807.     GOTO a label.
  808.  
  809.     LS
  810.     Equivalent to dir.
  811.  
  812.     MD
  813.     Equivalent to mkdir.
  814.  
  815.     MEM
  816.     Usage    : mem
  817.  
  818.     Display current memory statistics for CHIP memory and
  819.     FAST memory (if any installed).
  820.  
  821.     MKDIR
  822.     (MD)
  823.     Usage    : mkdir name name name...
  824.     Example    : mkdir df0:stuff
  825.  
  826.     Create the specified directories.
  827.  
  828.     MV
  829.     Equivalent to rename.
  830.  
  831.     OPEN
  832.     Usage    : open filename filemode filenumber
  833.     Example    : open RAM:data w 1
  834.  
  835.     This allows you to open a file, redirect to it as many commands
  836.     as you like, then close it.
  837.     Filename is any valid AmigaDOS filename, filemode is either r
  838.     for read or w for write, filenumber is a number between 1 and 10.
  839.     To redirect a program to or from an open file, use as your redir
  840.     filename a dot followed by the filenumber.
  841.     Here is a complete example:
  842.  
  843.         open RAM:data w 1
  844.         echo -n 2+2= >.1
  845.         rpn 2 2 + . CR >.1
  846.         close 1
  847.         type RAM:data    # will display 2+2=4
  848.     See also close, flist.
  849.  
  850.     PATH
  851.     Usage    : path
  852.  
  853.     Used to list AmigaDOS path. In current version can't be used to
  854.     set it.
  855.  
  856.     PRI
  857.     Usage    : pri clinumber pri
  858.     Example    : pri 3 5    # set priority of cli #3 to 5
  859.  
  860.     Change the priority of the specified task (use PS command to
  861.     determine clinumber). If you specify 0 as clinumber you can
  862.     change priority of "this" task (the one executing shell).
  863.  
  864.     PROTECT
  865.     Usage    : protect file1 ... filen [flags]
  866.     Example    : protect myfile rwe
  867.  
  868.     Set AMIGADOS file protection flags for the file specified. Valid
  869.     flags are h, s, p, a, r, w, e, d.
  870.     If you don't specify the flags, all flags are cleared.
  871.     Bit 'a' is new to WorkBench 1.2, while 'h', 's', 'p' are new to 1.3.
  872.  
  873.     PS
  874.     Usage    : ps
  875.  
  876.     Gives status of DOS processes.  eg:
  877.  
  878.     Proc Command Name    CLI Type    Pri.  Address  Directory
  879.      1   SHELL        Initial CLI   0      97b0  Stuff:shell
  880.      2   sys:c/clockmem    Background  -10    2101a8  Workdisk:
  881.      3   c:emacs        Background    0    212f58  Stuff:shell
  882.      4   sys:c/VT100    Background    0    227328  Workdisk:
  883.  
  884.     Address is the addres of the task, directory is the process
  885.     currently CD'd directory.
  886.  
  887.     PWD
  888.     Usage    : pwd
  889.  
  890.     Rebuild _cwd by backtracing from your current directory.
  891.  
  892.     QUIT
  893.     Usage    : quit
  894.  
  895.     Quit out of Shell back to CLI.
  896.  
  897.     RBACK
  898.     Usage    : rback command
  899.  
  900.     Start a new process executing the specified command, but can't do
  901.     input/output. Equivalent to 'run command >NIL: <NIL:'.
  902.  
  903.     RENAME
  904.     (MV)
  905.     Usage    : rename from to
  906.     or    : rename from from from ... from todir
  907.  
  908.     Allows you to rename a file or move it around within a disk.
  909.     Allows you to move 1 or more files into a single directory.
  910.  
  911.     RESIDENT
  912.     Usage    : resident [-r][-d] [files]
  913.     Example    : resident lc1 lc2 blink    # load these as resident
  914.           resident -d lc1 lc2 blink    # defer load when needed
  915.           resident -r lc1 lc2 blink    # remove these
  916.           resident            # list resident programs
  917.  
  918.     This is ARP resident. Commands are searched by Shell in resident
  919.     list BEFORE of searching on any external device.
  920.     Only PURE programs can run as resident, see ARP docs for more info.
  921.     Option -d is very useful: you can say, in your startup file,
  922.     resident -d file...file; programs will not be loaded immediately,
  923.     but only when you will try to load them. This way, you will not
  924.     waste memory and startup time if you don't use the programs.
  925.     Old option -a has no more effect.
  926.  
  927.     RETURN
  928.     Usage    : return [n]
  929.     Example    : return 10
  930.  
  931.     Exit from a script file, or quit from shell with optional
  932.     exit code.
  933.  
  934.     RM
  935.     Equivalent to delete.
  936.  
  937.     RPN
  938.     Usage    : rpn expression
  939.     Example    : rpn 3 7 *    # Prints the value 21
  940.  
  941.     Evaluate an RPN expression, using 32-bit values. In older versions
  942.     of Shell RPN contained string functions too, but now that strings
  943.     are handled by specifical commands, these are no more needed.
  944.     At end of evaluation, RPN prints values on stack, so you can
  945.     say for instance "rpn $x 2 * | input x" to double the value of
  946.     variable x.
  947.     Functions implemented are:
  948.  
  949.         + - * /    Obvious meaning; / means integer division, of course
  950.         %        Module operator e.g. "rpn 7 3 %" answers 1
  951.         & | ~    Bitwise and, or, not operators
  952.         > < ==    Tests for greater-than, lower-than, equal. To get
  953.             a test for >= (or <=), you can use < ! (or > !)
  954.         !        Logical not operator
  955.         DUP        Duplicate value on top of stack
  956.         DROP    Drop value on top of stack
  957.         SWAP    Swap two values on top of stack
  958.  
  959.     RUN
  960.     Usage    : run prgm args
  961.     Example    : run emacs test.c
  962.  
  963.     Start a new process executing the specified command.
  964.     In current implementation run command can't be redirected.
  965.     This command is not fully reliable: use at your own risk.
  966.     See also rback.
  967.  
  968.     RXREC
  969.     Usage    : rxrec [portname]
  970.  
  971.     Create an AREXX-compatible port of the specified name (defaults to
  972.     "rexx_csh"), then puts Shell to sleep waiting for messages on it.
  973.  
  974.     CAUTION: the only way to exit from this status is to send to the port
  975.     the message "bye".
  976.  
  977.     Example:
  978.     Open two Shell's in two separate CLI's. From the first, type:
  979.  
  980.         rxrec
  981.  
  982.     Now first Shell doesn't respond to keyboard input; instead, it waits
  983.     for messages on a port called "rexx_csh". Now, from the other, type:
  984.  
  985.         rxsend rexx_csh "dir df0:"
  986.  
  987.     You will see the listing of df0: in the first Shell. Experiment as you
  988.     like, then:
  989.  
  990.         rxsend rexx_csh bye
  991.  
  992.     And all will return to normal.
  993.  
  994.     RXSEND
  995.     Usage    : rxsend portname commands
  996.  
  997.     Send a command to any program with an AREXX-compatible port.
  998.     You don't have to load anything to use these command (or rxrec):
  999.     all you need is a program with the right port.
  1000.  
  1001.     An example is CygnusEdProfessional: here is, for instance, a command
  1002.     to wake it up, load the file test.c and jump to line 20:
  1003.  
  1004.         rxsend rexx_ced cedtofront "open test.c" "jmp to line 20"
  1005.         # rexx_ced is the name of AREXX port for CygnusEd
  1006.  
  1007.     Refer to your application manual for details and for the name of the
  1008.     port.
  1009.  
  1010.     SEARCH
  1011.     Usage    : search [-w][-c][-n][-r][-e][-q] filelist string
  1012.  
  1013.     Search specified files for a string. Only lines containing the
  1014.     specified strings are displayed.
  1015.  
  1016.     If the filename is STDIN (in uppercase) the standard input is
  1017.     used, so you can use search as the destination for a pipe.
  1018.     Example:
  1019.         strings myprog 8 | search STDIN .library
  1020.     Lists all libraries used in "myprog".
  1021.  
  1022.     If you specify any directory in filelist, and use the -r (recurse)
  1023.     switch, all files in directory are recursively searched.
  1024.  
  1025.     Lines are numbered for default; use -n (number) switch to turn off
  1026.     line numbering.
  1027.  
  1028.     Search is normally not case sensitive; use -c (case) flag to turn ON
  1029.     case sensitivity.
  1030.  
  1031.     By specifying -e (exclude) switch, only lines NOT containing the
  1032.     specified string are listed.
  1033.  
  1034.     Using -w (wild) flag, only the lines matching with the string are
  1035.     listed.
  1036.     Notes to wild card matching;
  1037.     - Uses Shell standard matching.
  1038.     - All standard ARP wildcards are allowed * ? [] () | ~ ' #
  1039.     - The WHOLE line must match the string, not only a substring.
  1040.     - String MUST be enclosed in quotes to avoid wildcard expansion
  1041.  
  1042.     Flag -q (quiet) suppresses printing of file names.
  1043.  
  1044.     Examples:
  1045.         search -cr df0:include ACCESS
  1046.     Find all occurrencies of ACCESS (in uppercase) in all files
  1047.     contained in include directory.
  1048.         search -w shell.h "'#define*"
  1049.     Lists only lines of file beginning with (not simply containing)
  1050.     #define. Note the use of ' to escape the special symbol #.
  1051.  
  1052.     SET
  1053.     Usage    : set [name] [string]
  1054.     Example    : set abc hello
  1055.  
  1056.     Set with no args lists all current variable settings.
  1057.     Set with one arg lists the setting for that particular variable.
  1058.     Specifying name and string, stores the string into variable name.
  1059.  
  1060.     Also See the section on special _variables.
  1061.  
  1062.  
  1063.     SLEEP
  1064.     Usage    : sleep timeout
  1065.     Example    : sleep 10
  1066.  
  1067.     Sleep for 'timeout' seconds, or until ^C typed.
  1068.  
  1069.     STACK
  1070.     Usage    : stack [number]
  1071.     Example    : stack 8000
  1072.  
  1073.     Changes the default stack for this CLI. Without arguments, prints
  1074.     it.
  1075.  
  1076.     STRHEAD
  1077.     Usage    : strhead varname breakchar string
  1078.     Example    : strhead x . foobar.bas    # Will set x to "foobar"
  1079.  
  1080.     Remove everything after and including the breakchar in 'string' and
  1081.     place in variable 'varname'.
  1082.  
  1083.     STRINGS
  1084.     Usage    : strings file1..fileN minlenght
  1085.     Example    : strings c:dir c:list shell 7
  1086.  
  1087.     Prints strings contained in specified files (usually binary)
  1088.     with lenght >= minlenght.
  1089.  
  1090.     STRLEFT
  1091.     Usage    : strleft varname string n
  1092.     Example    : strleft x LongString 5    # Will set x to "LongS"
  1093.  
  1094.     Place leftmost n chars of string in variable varname.
  1095.  
  1096.     STRLEN
  1097.     Usage    : strlen varname string
  1098.     Example    : strlen x Hello        # Will set x to "5"
  1099.  
  1100.     Puts len of string in variable varname.
  1101.  
  1102.     STRMID
  1103.     Usage    : strmid varname string n1 [n2]
  1104.     Example    : strmid x LongString 5 3    # Will set x to "Str"
  1105.  
  1106.     Places n2 chars from string, starting at n1, in variable varname.
  1107.     By omitting n2, you get all chars from n1 to end of string.
  1108.  
  1109.     STRRIGHT
  1110.     Usage    : strright varname string n
  1111.     Example    : strright x LongString 5    # Will set x to "tring"
  1112.  
  1113.     Place rightmost n chars of string in variable varname.
  1114.  
  1115.     STRTAIL
  1116.     Usage    : strtail varname breakchar string
  1117.     Example    : strtail x . foobar.bas    # Will set x to "bas"
  1118.  
  1119.     Remove everything before and including the breakchar in 'string' and
  1120.     place in variable 'varname'.
  1121.  
  1122.     SOURCE
  1123.     Usage    : source file [arguments]
  1124.     Example    : source mymake.sh all
  1125.     Result    : source file 'mymake.sh' called with var _passed = 'all'
  1126.  
  1127.     Execute commands from a file.  You can create SHELL programs in
  1128.     a file and then execute them with this command.  Source'd files
  1129.     have the added advantage that you can have loops in your command
  1130.     files (see GOTO and LABEL).  You can pass SOURCE files arguments
  1131.     by specifying arguments after the file name.  Arguments are passed
  1132.     via the _passed variable (as a single string).
  1133.  
  1134.     Long lines may be split by appending a backslash (\) at end of
  1135.     first half. However, even joined lines cannot be longer than
  1136.     ~255 chars. See example of source files.
  1137.  
  1138.     Automatic 'sourcing' is accomplished by placing a .sh extension on
  1139.     the file and executing it as you would a C program:
  1140.  
  1141.     --------- file hello.sh ---------
  1142.     foreach i ( $_passed ) "echo yo $i"
  1143.     ---------------------------------
  1144.  
  1145.     $ hello a b c
  1146.     yo a
  1147.     yo b
  1148.     yo c
  1149.  
  1150.     TACKON
  1151.     Usage    : tackon var pathname filename
  1152.     Example    : tackon x df0:c Dir    # sets x to "df0:c/Dir"
  1153.     or    : tackon x df0: Preferences #sets x to "df0:Preferences"
  1154.  
  1155.     Correctly adds a filename to a pathname, and puts the result in
  1156.     variable specified.
  1157.  
  1158.     TYPE
  1159.     Equivalent to CAT.
  1160.  
  1161.     TOUCH
  1162.     Usage    : touch file1 .. fileN
  1163.  
  1164.     Sets DateStamp on the specified files to the current date and time.
  1165.  
  1166.     UNALIAS
  1167.     Usage    : unalias name .. name
  1168.     Example    : unalias vt
  1169.  
  1170.     Delete aliases..
  1171.  
  1172.     UNSET
  1173.     Usage    : unset name .. name
  1174.     Example    : unset abc
  1175.  
  1176.     Unset one or more variables.  Deletes them entirely.
  1177.  
  1178.     VER
  1179.     Usage    : ver
  1180.  
  1181.     Show current version name, & authors.
  1182.  
  1183.     WINDOW
  1184.     Usage    : window [-q][-f][-b][-l][-s] [dimensions]
  1185.     Options    :
  1186.         -f    (front) Window to front
  1187.         -b    (back)  Window to back
  1188.         -l    (large) Window to maximum size
  1189.         -s    (small) Window to minimum size
  1190.         -a    (activate)
  1191.         -q    (query) Lists screens and windows open
  1192.  
  1193.     Various operations on CLI window. If dimensions are specified,
  1194.     they must be in the form x y width height, with values separated
  1195.     by spaces.
  1196.     The command "window -l" may be very useful on PAL machines to
  1197.     get a full PAL window from your login sequence, or if you use
  1198.     overscan WorkBench.
  1199.     Option -q gives, for each Screen and Window currently open,
  1200.     title, left edge, top edge, width, height.
  1201.  
  1202.  
  1203. IX. SPECIAL SET VARIABLES
  1204.     ---------------------
  1205.  
  1206.     _prompt
  1207.     This variable is set to the string you wish printed as your
  1208.     prompt. This can contain escape sequences if you wish, or
  1209.     you can include a %p in path definition to get CD in your
  1210.     prompt.
  1211.     Default prompt shows path specification in red pen, followed by
  1212.     a greater (>) sign and a space.
  1213.     The if command will set the prompt to a '_ ' if commands are
  1214.     disabled while waiting for a 'endif' or 'else' command. Interactive
  1215.     mode only.
  1216.  
  1217.     _history
  1218.     This variable is set to a numerical value, and specifies how far
  1219.     back your history should extend.
  1220.  
  1221.     _debug
  1222.     Debug mode... use it if you dare.  must be set to some value
  1223.  
  1224.     _verbose
  1225.     Verbose mode (for source files).  display commands as they are
  1226.     executed.
  1227.  
  1228.     _maxerr
  1229.     The worst (highest) return value to date.  To use this, you usually
  1230.     set it to '0', then do some set of commands, then check it.
  1231.  
  1232.     _lasterr
  1233.     Return code of last command executed.  This includes internal
  1234.     commands as well as external comands, so to use this variables
  1235.     you must check it IMMEDIATELY after the command in question.
  1236.  
  1237.     _cwd
  1238.     Holds a string representing the current directory we are in from
  1239.     root.  The SHELL can get confused as to its current directory if
  1240.     some external program changes the directory.  Use PWD to rebuild
  1241.     the _cwd variable in these cases.
  1242.  
  1243.     _passed
  1244.     This variable contains the passed arguments when you SOURCE a file
  1245.     or execute a .sh file.  For instance:
  1246.  
  1247.     test a b c d
  1248.  
  1249.     -------- file test.sh ----------
  1250.     echo $_passed
  1251.     foreach i ( $_passed ) "echo YO $i"
  1252.     --------------------------------
  1253.  
  1254.     _path
  1255.     This variable contains the search path when the shell is looking
  1256.     for external commands.  The format is:  DIR,DIR,DIR  Each DIR must
  1257.     have a trailing ':' or '/'.  The current directory is always
  1258.     searched first.  The entire path will be searched first for the
  1259.     <command>, then for <command>.sh (automatic shell script sourcing).
  1260.  
  1261.     The default _path is set to
  1262.         ram:,ram:c/,df0:c/,df1:c/,df0:,df1:,sys:system/
  1263.  
  1264.     _insert
  1265.     Sets the default for insert/overtype mode for command line
  1266.     editing. ^A toggles between, but after <RET> the default is
  1267.     set back as indicated by this variable. By default _insert is 1
  1268.     indicating insert mode on setting to zero will make overtype
  1269.     the default.
  1270.  
  1271.     _titlebar
  1272.     Used to set window's title bar.
  1273.  
  1274.     _clinumber
  1275.     Contains the number (1-20) of current CLI.
  1276.  
  1277. X.  ADVANCED TOPICS
  1278.     ---------------
  1279.  
  1280.     EXCEPTION_PROCESSING:
  1281.  
  1282.     if no _except variable exists, any command which fails causes the
  1283.     rest of the line to abort as if an ABORTLINE had been executed.  If
  1284.     the _except variable exists, it is of the form:
  1285.  
  1286.     "nnn;commands..."
  1287.  
  1288.     where nnn is some value representing the minimum return code required
  1289.     to cause an error.  Whenever a command returns a code which is
  1290.     larger or equal to nnn, the commands in _except are executed before
  1291.     anything.  WHEN _except EXISTS, THE COMMAND LINE DOES NOT ABORT
  1292.     AUTOMATICALLY.  Thus, if you want the current line being executed
  1293.     to be aborted, the last command in _except should be an "abortline".
  1294.  
  1295.     exception handling is disabled while in the exception handling routine
  1296.     (thus you can't get into any infinite loops this way).
  1297.  
  1298.     Thus if _except = ";", return codes are completely ignored.
  1299.  
  1300.     example:
  1301.  
  1302.     set _except "20;abortline"
  1303.  
  1304. XI. EXAMPLE LOGIN FILE
  1305.     ------------------
  1306.  
  1307. If from a CLI or the startup-script you say 'SHELL filename', that file is
  1308. sourced first.
  1309. Moreover, if you have a file called S:.login, it will be sourced for every
  1310. Shell you run. This is useful for alias and setting that you want in ALL
  1311. Shells.
  1312. If you are a CLI user, your startup-sequence may be as simple as:
  1313.  
  1314.     C:Shell S:login.sh
  1315.  
  1316. Here is, my startup code:
  1317.  
  1318. ### Example S:login.sh ###
  1319.  
  1320. window -l    # if you are on a PAL machine, or use overscan
  1321.  
  1322. set _prompt ^[[33m[$_clinumber].%p>" "
  1323.  
  1324. set F5 "cdir WORK:"^M
  1325. set f9 "ed s:login.sh"^M
  1326. set F9 "ed df0:s/startup-sequence"^M
  1327. alias toram  "%q foreach i ( $q ) \"cp -r $i: ram:$i >NIL:;\
  1328.     assign $i: ram:$i\""
  1329. alias ramop  "md RAM:op; assign OP: ram:op"
  1330. alias noop   "assign OP: ; rm -r ram:op"
  1331. alias newop  "rm -r OP:*"
  1332. alias dc     "dfc df0: to df1:"
  1333. alias go     "%q assign WORK: Boot:$q; cd WORK:; source startme.sh"
  1334. alias get    "%q cp $q RAM: >NIL:"
  1335.  
  1336. assign LC:    Stuff:c
  1337. assign INCLUDE:    Stuff:include
  1338. assign LIB:    Boot:lib
  1339. assign QUAD:    RAM:
  1340.  
  1341. rback C:FaccII; sleep 1
  1342.     # after spawning a process, it is always better to allow it
  1343.     # to load the command, to avoid excessive drive head movement
  1344.  
  1345. resident -a LC:Blink LC:lc1 LC:lc2 >NIL:
  1346.  
  1347. C:PopCli 300 C:Newcli
  1348. C:FF -1 Siesta.font >NIL:
  1349. C:Patch_1 >NIL:
  1350. stack 8000    # lc1 and lc2 need this
  1351.  
  1352. source S:setdate.sh    # this is listed in next chapter
  1353.  
  1354. ### End of example login.sh ###
  1355.  
  1356.  
  1357. XII.  Example Source files
  1358.       --------------------
  1359.  
  1360. The following is an example source file to set date and time; it may be
  1361. used at startup if you don't have an internal clock.
  1362.  
  1363. ### setdate.sh ###
  1364.  
  1365. open CON:200/100/440/80/SetDate write 1
  1366. echo >.1 -n "Current date is "
  1367. date >.1
  1368. echo >.1 -n "Please enter date: "
  1369. input <.1 d
  1370. close 1
  1371. strlen len $d
  1372. if -r $len 1 > ; date $d ; endif
  1373. echo -n "New date: " ; date
  1374.  
  1375. ### End of setdate.sh ###
  1376.  
  1377. Next comes a makefile that needs no Make program: may be executed from
  1378. Shell directely!!!
  1379.  
  1380. ### make.sh ###
  1381.  
  1382. if -t Shell.syms Shell.h; cc +HShell.syms Shell.h; rm shell.o; endif
  1383. if -t RAM:Shell.syms Shell.syms; cp -d Shell.syms RAM:; endif
  1384.  
  1385. foreach i ( main comm1 comm2 comm3 execom globals rawconsole run set \
  1386.  sub ) "if -t $i.o $i.c; echo Compile $i...;cc +IRAM:shell.syms $i.c; endif"
  1387.  
  1388. if -t Shell run.o main.o comm1.o comm2.o comm3.o execom.o \
  1389. set.o sub.o globals.o rawconsole.o
  1390.             ln  +q -m -o Shell run.o main.o comm1.o comm2.o comm3.o\
  1391.         execom.o set.o sub.o globals.o rawconsole.o -la -lc
  1392. endif
  1393.  
  1394. ### End of make.sh ###
  1395.  
  1396.  
  1397. XIII.  Default Values
  1398.        --------------
  1399.  
  1400. To make things easier, some aliases are predefined whenever you start a
  1401. new Shell. These are:
  1402.  
  1403.     - cls
  1404.     Simply clear the screen.
  1405.  
  1406.     - cdir
  1407.     Use "cdir directory" to clear the screen, set CD to directory,
  1408.     and list it.
  1409.  
  1410.     - kr
  1411.     Deletes everything on RAM:. If you think this is dangerous,
  1412.     you can remove this alias.
  1413.  
  1414.     - exit
  1415.     Leave Shell and exit CLI.
  1416.  
  1417. Moreover, many variables have default values, and many function keys are
  1418. predefined. You can use set command to determine all of these.
  1419.  
  1420. XIV.  Why ARP ?
  1421.       ---------
  1422.  
  1423. For those of you curious enough, the A in "3.xxA" means ARP. The most
  1424. recent versions of Shell use ARP.library. This has been very useful in:
  1425.  
  1426.  - Implementing commands like ASET, ASSIGN, INFO, RESIDENT, RBACK, RUN.
  1427.  - Keeping executable code small.
  1428.  
  1429. ARP.library is really public domain, so one can include it in any package,
  1430. both commercial or public domain, like I am doing with Shell.
  1431. The ARP team is trying to wipe out the BCPL from AMIGA. This is a very
  1432. good idea, I think. And there is a lot of people hoping that Commodore
  1433. will put ARP.library in ROM, before or after. This would  make the AMIGA
  1434. a very mory friendly computer to use and program.
  1435. I encourage programmers to get ARP development package: you can find it
  1436. on many BBS, and is really public domain. Users can look for a replacement
  1437. of C: commands from ARP (but, of course, if you use this Shell you won't
  1438. need them anymore, except for ARUN).
  1439.  
  1440.